﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    CodeFile="AddPrice.aspx.cs" Inherits="Admin_Price" EnableViewState="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainPlace" runat="Server">
    <div>
        
        <asp:HiddenField ID="hfID" runat="server" />
        <asp:Label runat="server" ID="lblTextTitle"></asp:Label><br />
        <asp:TextBox ID="txtMainBlockTitle" runat="server" Width="400px"></asp:TextBox><br />
        <asp:Label runat="server" ID="lblTextContent" Text="Статья"></asp:Label><br />
        <asp:TextBox runat="server" ID="txtContent" TextMode="MultiLine" Height="150px" Width="400px"></asp:TextBox>
        <br />
        <asp:Button ID="btnArticleSave" runat="server" Text="Сохранить" OnClick="btnArticleSave_Click" />


        <asp:DropDownList runat="server" ID="ddType" DataTextField="TagName" DataValueField="id"
            AutoPostBack="true" EnableViewState="true" OnSelectedIndexChanged="ddType_SelectedIndexChanged">
        </asp:DropDownList>
        <asp:GridView runat="server" ID="dgPriceList" AutoGenerateColumns="false" OnRowEditing="dgPriceList_RowEditing"
            OnRowCancelingEdit="dgPriceList_RowCancelingEdit" OnRowUpdating="dgPriceList_RowUpdating"
            ShowFooter="true" OnRowDeleting="dgPriceList_RowDeleting" AllowPaging="false">
            <EmptyDataTemplate>
                <table style="border: 1px; border-color: #DFDFDF">
                    <tr style="background-color: #808080">
                        <td style="color: White; font-weight: bold;">
                            Price
                        </td>
                        <td style="color: White; font-weight: bold;">
                            Description
                        </td>
                        <td style="color: White; font-weight: bold;">
                            פעולות
                        </td>
                    </tr>
                    <tr style="background-color: #CCCC99">
                        <td>
                            <asp:TextBox ID="txtPrice" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="txtDescription" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Button ID="btnFooterSave" runat="server" Text="Добавить" OnClick="btnFooterSave_Click" />
                        </td>
                    </tr>
                </table>
            </EmptyDataTemplate>
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <div>
                            Price</div>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HiddenField runat="server" ID="hfID" Value='<%# Eval("ID") %>' />
                        <asp:Label runat="server" ID="lblPrice" Text='<%# Eval("Price") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:HiddenField runat="server" ID="hfID" Value='<%# Eval("ID") %>' />
                        <asp:TextBox runat="server" ID="txtPrice" Text='<%# Eval("Price") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox runat="server" ID="txtPrice" Text=""></asp:TextBox>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <div>
                            Description</div>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblDescription" Text='<%# Eval("Description") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtDescription" runat="server" Text='<%# Eval("Description") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="txtDescription" runat="server" Text=""></asp:TextBox>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <div>
                            Действие</div>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Button ID="btnChange" runat="server" Text="Изменить" CommandName="Edit" />
                        <asp:Button ID="btnDelete" runat="server" Text="Удалить" CommandName="Delete" />
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:Button ID="btnCancel" runat="server" Text="Назад" CommandName="Cancel" />
                        <asp:Button ID="btnSave" runat="server" Text="Сохранить" CommandName="Update" />
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:Button ID="btnFooterSave" runat="server" Text="Добавить" OnClick="btnFooterSave_Click" />
                    </FooterTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
</asp:Content>
